<template>
  <footer>
    <input type="text" v-model="title" />
    <input type="text" v-model="content" />
    <button @click="send">发布</button>
  </footer>
</template>

<script>
export default {
  data() {
    return {
      title: "",
      content: "",
    };
  },
  methods: {
    send() {
      // console.log("title:", this.title);
      // console.log("content:", this.content);
      // this.$emit("getItem", this.title, this.content);

      this.$emit("getItem", { title: this.title, content: this.content });
      this.title = "";
      this.content = "";
    },
  },
};
</script>

<style scoped>
footer {
  width: 100%;
  height: 60px;
  border-top: 1px solid #000;
  position: absolute;
  bottom: 0;
  left: 0;
  display: flex;
  justify-content: space-around;
  align-items: center;
}
</style>
